//
//  WBNetworkManager + Extention.swift
//  PersonalWeibo
//
//  Created by Liuwx on 2017/9/26.
//  Copyright © 2017年 Liuwx. All rights reserved.
//

import UIKit

//封装新浪微博的请求
extension WBNetworkManager {
  
    func statusList(completion: @escaping (_ list: [[String: AnyObject]]?, _ isSuccess: Bool)->()) {
        let urlString = "https://api.weibo.com/2/statuses/home_timeline.json"
        
        let params = ["access_token": "2.00ZTgZ1GfN_U2E2553656b710BoFnr"]
        
       
        
        WBNetworkManager.shared.request(URLString: urlString, parameters: params as [String : AnyObject]) { (json, isSuccess) in
            
            print(json ?? 0)
              let json = json as? [String: AnyObject]
            let result =  json?["statuses"] as? [[String : AnyObject]]
            
            completion(result, isSuccess)
        }
 
    }
}
